The Xen console intercepts ^O and prevents it from propagating
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Mon, 12 Mar 2007 11:04:34 +0000 (11:04 +0000)
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Mon, 12 Mar 2007 11:04:34 +0000 (11:04 +0000)
through to the guest.  However, ^O is a useful key in bash and in
Emacs.  This patch changes the console to pass a single ^O
through to the guest when it is pressed twice.

Signed-off-by: Ben Pfaff <blp@cs.stanford.edu>
linux-2.6-xen-sparse/drivers/xen/console/console.c

index 78fbc79940e1bf515624cb4c2191773f5f6780e3..1053ef8ff1ea627843a7f244ed607716a6c0c7f4 100644 (file)
@@ -348,8 +348,11 @@ void xencons_rx(char *buf, unsigned len, struct pt_regs *regs)
 #ifdef CONFIG_MAGIC_SYSRQ
                if (sysrq_enabled) {
                        if (buf[i] == '\x0f') { /* ^O */
-                               sysrq_requested = jiffies;
-                               continue; /* don't print the sysrq key */
+                               if (!sysrq_requested) {
+                                       sysrq_requested = jiffies;
+                                       continue; /* don't print sysrq key */
+                               }
+                               sysrq_requested = 0;
                        } else if (sysrq_requested) {
                                unsigned long sysrq_timeout =
                                        sysrq_requested + HZ*2;